﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NutWinFrm.WinFrms
{
    public partial class RegexFrm : Form
    {
        public RegexFrm()
        {
            InitializeComponent();
        }

        private void btn_regex_Click(object sender, EventArgs e)
        {
            //[a-zA-Z]{2,6}-\d{2,7}  aaa-bbb
            String src = richTextBox_src.Text.Trim();
            Regex patten = new Regex(textBox_regex.Text);
            MatchCollection mc = patten.Matches(richTextBox_src.Text.Trim());
            foreach (Match item in mc)
            {
                result.AppendText(item.Value);
            }

        }
    }
}
